#ifndef FASTNET_NODE_HH
#define FASTNET_NODE_HH

#include <iostream>

namespace brain {

    class Builder;
    class Connection;

    class Node {
        friend class Builder;
        friend class Connection;

        float x, y;
        Node(float x, float y) : x(x), y(y) { }

    public:
        float get_x() const { return x; }
        float get_y() const { return y; }
        void set_x(float x) { this->x = x; }
        void set_y(float y) { this->y = y; }

        friend bool operator < (Node const& a, Node const& b) {
            if (a.x < b.x) return true;
            else if (a.x > b.x) return false;

            if (a.y < b.y) return true;
            else return false;
        }

        friend bool operator == (Node const& a, Node const b) {
            return (a.x == b.x && a.y == b.y);
        }

        friend std::ostream& operator << (std::ostream& out, Node const& n) {
            return out << "(" << n.x << ", " << n.y << ") "; 
        }

    };

}

#endif
